package com.springboot.cloud.demos.feign.service;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.entity.form.MomentForm;
import com.springboot.cloud.demos.entity.po.Moment;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(name = "ribbon-consumer", fallback = MomentServiceFallback.class)
public interface MomentService {

    @RequestMapping(value = "/moment", method = RequestMethod.POST)
    Result<Moment> save(@RequestBody MomentForm momentForm);

    @RequestMapping(value = "/moment/{id}", method = RequestMethod.GET)
    Result<Moment> get(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/moment/getMomentMap", method = RequestMethod.GET)
    Result getMomentMap(@RequestParam(value = "id") String id);

    @RequestMapping(value = "/moment/{id}", method = RequestMethod.DELETE)
    Result delete(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/moment/list/{userId}", method = RequestMethod.GET)
    Result list(@PathVariable(value = "userId") String userId, @RequestParam(value = "type") Integer type, @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize);

    @RequestMapping(value = "/moment/followList", method = RequestMethod.GET)
    Result followList(@RequestParam(value = "userId") String userId, @RequestParam(value = "sex") Integer sex, @RequestParam(value = "real") Integer real, @RequestParam(value = "pretty") Integer pretty, @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize);

    @RequestMapping(value = "/moment/recommendList", method = RequestMethod.GET)
    Result recommendList(@RequestParam(value = "userId") String id, @RequestParam(value = "sex") Integer sex, @RequestParam(value = "real") Integer real, @RequestParam(value = "pretty") Integer pretty, @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize);

    @RequestMapping(value = "/moment/broadcastList", method = RequestMethod.GET)
    Result broadcastList(@RequestParam(value = "sex") Integer sex, @RequestParam(value = "real") Integer real, @RequestParam(value = "pretty") Integer pretty,@RequestParam(value = "type") Integer type, @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize);

    @RequestMapping(value = "/moment/nearbyList", method = RequestMethod.GET)
    Result nearbyList(@RequestParam(value = "sex") Integer sex, @RequestParam(value = "real") Integer real, @RequestParam(value = "pretty") Integer pretty, @RequestParam(value = "longitude") float longitude, @RequestParam(value = "latitude") float latitude, @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize);

    @RequestMapping(value = "/moment/next", method = RequestMethod.GET)
    Result next(@RequestParam(value = "momentId") String momentId);

    @RequestMapping(value = "/moment/prev", method = RequestMethod.GET)
    Result prev(@RequestParam(value = "momentId") String momentId);
}
